//
//  MGItem.m
//  Express
//
//  Created by lhongl on 2025/9/25.
//  Copyright © 2025 QM. All rights reserved.
//

#import "MGItem.h"
#import "MGTableViewManage.h"
#import "MGSection.h"
@interface MGItem ()
{
    id _data;
}

@property (nonatomic, copy) NSString *cellIdentifier;

@end
@implementation MGItem

- (instancetype)initWithData:(nullable id)data cellClass:(Class)cellClass{
    if (self = [super init]) {
        self.rowHeight = 44;
        _data = data;
        NSString *cellIdent = NSStringFromClass(cellClass);
        self.cellIdentifier = cellIdent;
    }
    return self;
}

/// 数据
- (id)data{
    return _data;
}

/// 标记
- (NSString *)identifier{

    return self.cellIdentifier;
}

/// 下标
- (NSIndexPath *)indexPath{
    return [NSIndexPath indexPathForRow:[self.section.itemList indexOfObject:self] inSection:[self.section.tableManage.sections indexOfObject:self.section]];
}

- (void)tableViewManage:(MGTableViewManage *)tableViewManage cell:(__kindof UITableViewCell *)cell{

}

@end
